package com.byq.mm.common.engine.listener;

import com.byq.mm.common.engine.Environment;

import org.jivesoftware.smack.ConnectionListener;
import org.jivesoftware.smack.XMPPConnection;

public class SmartConnectionListener  extends AbstractListener implements ConnectionListener{

	public SmartConnectionListener(Environment e) {
		super(e);

	}

	@Override
	public void connected(XMPPConnection connection) {

	}

	@Override
	public void authenticated(XMPPConnection connection, boolean resumed) {

	}

	public void connectionClosed() {
		this.env.getEventCenter().notifyConnectionClosed();
	}

	public void connectionClosedOnError(Exception e) {
	
		this.env.getEventCenter().notifyConnectionClosedOnError(e);
	
	}

	public void reconnectingIn(int seconds) {
		this.env.getEventCenter().notifyReconnectingIn(seconds);
	}

	public void reconnectionFailed(Exception e) {
		this.env.getEventCenter().notifyReconnectionFailed(e);

	}

	public void reconnectionSuccessful() {
		this.env.getEventCenter().notifyReconnectionSuccessful();
	}
	

};